package com.aigc.bugaigc.service;

import com.aigc.bugaigc.entity.Bug;
import com.aigc.bugaigc.repository.BugRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReportService {
    @Autowired
    private BugRepository bugRepository;

    public List<Bug> getBugsByStatus(String status) {
        return bugRepository.findAllByStatus(status);
    }

    public int getBugCountByPriority(String priority) {
        return bugRepository.countByPriority(priority);
    }
}